/// @Classname : HcCalendarPage
/// @Author :
/// @Time : 2024-02-20 14:13
/// @Description : //todo


import 'package:flutter/material.dart';
import 'package:hc_ui/widget/calendar/calendar_bean.dart';
import 'package:hc_ui/widget/calendar/hc_calendar.dart';

class HcCalendarPage extends StatefulWidget {
  const HcCalendarPage({Key? key}) : super(key: key);

  @override
  State<HcCalendarPage> createState() => _HcCalendarPageState();
}

class _HcCalendarPageState extends State<HcCalendarPage> {
  String name = "";

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: const Text('日历'),
      ),
      body: Column(
        children: [
          HcCalendar(
            onlyShowCurrentMonth: true,
            showToday: true,
            crossAxisSpacing: 5,
            mainAxisSpacing: 5,
            minDate: DateTime(2023, 12, 22),
            defaultValue: [],
            showMonthMark: true,
            readOnly: false,
            select: (HcCalendarSelectResult result) {
              // HcDialogUtil.showSingleBtnDialog(
              //     context: context,
              //     titleText: "这里是标题",
              //     buttonText: "我知道了",
              //     dialogIndexFunction: (index) {
              //       print("${index}");
              //     },
              //     content: const HcImage(src: 'assets/images/group.png'),
              //     warningText: "您确定要这么做吗");
            },
            formatter: (day) {
              if (day.day.weekday == 6 || day.day.weekday == 7) {
                day.dayStatus = HcCalendarDayStatus.disabled;
              }
              return day;
            },
            selectMode: HcCalendarSelectMode.single,
            firstDayOfWeek: 0,
          ),
        ],
      ),
    );
  }
}
